package com.haiya.application.query.assembler;

import com.haiya.application.query.dto.CargoDTO;
import com.haiya.infrastructure.db.dataobject.CargoDO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.function.Function;

/**
 * @author qiaoguoqiang
 */
@Component
public class CargoDTOAssembler implements Function<CargoDO, CargoDTO> {
    @Override
    public CargoDTO apply(CargoDO cargoDO) {
        CargoDTO target = new CargoDTO();
        BeanUtils.copyProperties(cargoDO, target);
        return target;
    }
}
